<template>
	<view class="cardstyle">
		<slot name="header"></slot>
		<!--  @click.stop 拦截系统原生点击事件 -->
		<text class="titlebox" @click.stop="handleTitleClick()">{{title}}</text>
		<view class="tipsbox">
			<text style="color: #f00;" v-if="isTop">置顶</text>
			<text @click="handleAuthorClick()">{{author}}</text>
			<text>{{comments}}评</text>
			<!-- <view style="flex:1; ">	</view><text >2025.10.25</text> -->
			<view style="flex:1; display: flex; justify-content: flex-end;">
				<text>{{time}}</text>
			</view>
		</view>
		<slot name="tips"></slot>
		<slot name="footer"></slot>
	</view>
</template>

<script>
	export default {
		name: "CardViewText",
		data() {
			return {

			};
		},
		props: {
			nid: {
				type: String,
				default: "000",
				require: true
			},
			title: {
				type: String,
				default: "新闻标题",
				require: true
			},
			isTop: {
				type: Boolean,
				default: false,
				require: true
			},
			author: {
				type: String,
				default: "来源",
				require: true
			},
			comments: {
				type: Number,
				default: 0,
				require: true
			},
			time: {
				type: String,
				default: "2025.1.1"
			}
		}
	}
</script>

<style>
	.cardstyle {
		display: flex;
		flex-direction: column;
		text-align: left;
		background-color: #eff;
		border-radius: 10px;
		padding-top: 10px;
		padding-bottom: 10px;
	}

	.titlebox {
		padding-left: 10px;
		/* font-weight:bold; */
	}

	.tipsbox {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		text-align: center;
		padding-left: 10px;
		margin-top: 5px;
	}

	.tipsbox text {
		margin-right: 10px;
		color: #aaa;
		font-size: 11px;
	}
</style>